package com.example.demo.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MinioConfig {
    @Value("${minio.accessKey}")
    private String accessKey;


    @Value("${minio.secretKey}")
    private String secretKey;

    @Value("${minio.addr}")
    private String addr;


    @Bean
    public MinioClient minioClient(){
        MinioClient minioClient=MinioClient.builder().credentials(accessKey,secretKey).endpoint(addr).build();
        return minioClient;
    }
}
